/**
 * @file   1084.cpp
 * @author Shuang Hu <hsmath@ubuntu>
 * @date   Sat Apr 24 03:16:13 2021
 * 
 * @brief  PAT advanced,1084
 * 
 * 
 */
#include<iostream>
#include<unordered_map>
#include<string>
using namespace std;
int main(){
    string s1,s2;
    cin>>s1;
    cin>>s2;
    unordered_map<char,bool> M1;
    unordered_map<char,int> M2;
    for(int i=0;i<s2.length();i++){
	if(s2[i]>='a'&&s2[i]<='z'){
	    M2[s2[i]+'A'-'a']++;
	}else{
	    M2[s2[i]]++;
	}
    }
    for(int i=0;i<s1.length();i++){
	char c=s1[i];
	if(c>='a'&&c<='z'){
	    c=c+'A'-'a';
	}
	if(M2.count(c)==0&&M1[c]==false){
	    M1[c]=true;
	    cout<<c;
	}
    }
    cout<<endl;
}
